/* 
 * File:   Complex.h
 * Author: Gab'z
 *
 * Created on 29 mai 2012, 12:26
 */

#ifndef COMPLEX_H
#define	COMPLEX_H

#include "Number.h"
#include "SimpleNumber.h"

namespace calculator {

    /**
     * Nombre Complexe.
     * Composé de 2 SimpleNumber.
     * 
     */
    class Complex : public Number {
    public:
        Complex(const Complex& orig);
        Complex(const SimpleNumber& x);
        Complex(const SimpleNumber* x);
        Complex(const SimpleNumber& x1, const SimpleNumber& x2);
        Complex(const SimpleNumber* x1, const SimpleNumber* x2);
        virtual ~Complex();

        SimpleNumber* getRe() const {
            return _re;
        }

        SimpleNumber* getIm() const {
            return _im;
        }

        /**
         * 
         * @return std::string("") si le mode complex est activé,
         * une chaîne non vide sinon
         */
        std::string isExecutable() const;
        Complex* clone() const;

        std::string toString() const;

        Complex& operator=(const Complex& c);
        Complex& operator+=(const Complex& c);
        Complex& operator-=(const Complex& c);
        Complex& operator*=(const Complex& c);
        Complex& operator/=(const Complex& c);
        Complex& pow(const SimpleNumber& sn);

    private:
        SimpleNumber* _re;
        SimpleNumber* _im;
    };
    Complex operator+(const Complex& c1, const Complex& c2);
    Complex operator-(const Complex& c1, const Complex& c2);
    Complex operator*(const Complex& c1, const Complex& c2);
    Complex operator/(const Complex& c1, const Complex& c2);
}

#endif	/* COMPLEX_H */

